# blame: christopher taylor (christopher(dot)paul(dot)taylor(at)gmail(dot)com
# released under terms of MPL (Mozilla Public License) 1.1 http://www.mozilla.org/MPL/
#

import glob
import sys
import distutils.sysconfig, os
import distutils.file_util

if sys.platform == "win32" :
	boost_prefix=r"C:\Documents and Settings\ct\Desktop\boost_1_39_0"
	boost_libdir=boost_prefix + "/libs/..../shared-linkable-true/"
	boost_include="C:\\MinGW\\include\\boost"
	python_include = 'C:\Python26\include'
	pyboostlib='boost_python-mgw34-mt-1_39'
	pylib = 'python26'
	cpppath = 'C:\MinGW/include/'
	libdir = 'C:\MinGW/lib'
	py_libdir='C:\Python26\libs'
	
else:
	boost_libdir = '/usr/lib'
	py_libdir = '/usr/lib'
	boost_include = '/usr/include'
	python_include = '/usr/include/python2.5'
	pyboostlib = 'libboost_python'
	cpppath = '/usr/local/include/bullet'
	libdir = '/usr/local/lib'
	
env = Environment(
   LIBPATH=['./', boost_libdir, py_libdir],
   CPPPATH=[boost_include, python_include],
   RPATH=['./', boost_libdir],
   LIBS=[pyboostlib,],	
)

vars = distutils.sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS', 'CCSHARED', 'LDSHARED', 'SO')
for i in range(len(vars)):
	if vars[i] is None:
		vars[i] = ""
		
(cc, cxx, opt, basecflags, ccshared, ldshared, so_ext) = vars

env['SHLIBPREFIX']=""   #gets rid of lib prefix
env['SHLIBSUFFIX']=so_ext

# add bullet
env.Append(
   LIBPATH=[libdir,],
   CPPPATH=[cpppath,],
   LIBS=[pylib,]
)


env.SharedLibrary(target='pylevenshtein', source=['levenshtein.cc', 'pylevenshtein.cpp'])

